package com.sky.mapper;

import com.sky.dto.GoodsSalesDTO;
import com.sky.entity.OrderDetail;
import org.apache.ibatis.annotations.Mapper;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface OrderDetailMapper {
    /**
     * 插入订单 的明细信息
     * @param orderDetailList
     */
    void insertBatch(List<OrderDetail> orderDetailList);

    /**
     * 根据订单id查询订单详细信息
     * @param ordersId
     * @return
     */
    List<OrderDetail> selectByOrderId(Long ordersId);

    /**
     * 统计销量前十的商品
     * @param map
     * @return
     */
    List<GoodsSalesDTO> selectTop10(HashMap<Object, Object> map);
}
